package com.zking.frame.TL;

import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Cursor;
import java.awt.Dimension;
import java.awt.EventQueue;
import java.awt.Font;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.swing.ImageIcon;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.WindowConstants;

import com.zking.bean.FilmMsg;

import com.zking.frame.LYK.HomepageJframe;
import com.zking.frame.LYK.SelectSeatJframe;
import com.zking.frame.TJ.mySpace;
import com.zking.frame.ZC.CinemaFrame;
import com.zking.utils.GetFilmAllData;

import java.awt.GridLayout;

public class FilmContent extends JFrame implements MouseListener{
	
	private static final long serialVersionUID = 1L;
	
	private JPanel JP_top;// 顶上导航栏
	private ImageIcon ImageIcon_top;// 顶部图片
	private JLabel logopic;//logo图片
	private JLabel city;// 选择城市
	private JLabel homepage;// 首页跳转按钮
	private JLabel film;// 影视页面跳转按钮
	private JLabel cinema;// 电影院页面调转按钮
	private JLabel personData;//个人中心
	private JLabel out;//退出
	private JPanel JP_under;//下方的面板
	private JPanel JP_movie_all;//电影所有面板
	private JPanel JP_movie_content;//电影详情面板
	private JLabel JP_movie_name;//电影名称
	private JLabel JL_movie_img;//电影图片
	private ImageIcon Img_movie_img;//图片
	private JPanel JP_movie_info;//电影信息
	private JPanel JP_selectSeat_all;//选座购票
	private JLabel director;
	private JLabel mainActors;
	private JLabel type;
	private JLabel location;
	private JLabel time;
	private JLabel introduction;
	private JLabel buyTikets;//购票选座
	private JPanel bqian;//选座信息标签
	
	private JPanel bqian_1;//第一行
	private JPanel bqian_2;//第一行
	private JPanel bqian_3;//第一行
	
	
	private JPanel changci;//电影场次信息
	
	private JLabel hallName;//影院名称
	private JLabel hallAddress;//影院地址
	private JLabel hallsInfor;//查看影院详情
	
	private JPanel seatInforTop;//信息表头部
	private ImageIcon img_seatInforTop;
	
	private JLabel selectArea;//选择区域
	private JLabel allArea;
	
	private JPanel changci_infor_1;
	private JPanel changci_infor_2;
	private JPanel changci_infor_3;
	private JPanel changci_infor_4;
	
	
	private JLabel beginTime;//开始时间
	private JLabel language;//语言
	private JLabel showAddress;//放映厅
	private JLabel seatsInfor;//座位情况
	private JLabel price;//价格
	private JLabel selectSeat;//选座
	private JLabel selectSeat1;//选座
	private JLabel selectSeat2;//选座
	
	private JLabel area_1;
	private JLabel area_2;
	private JLabel area_3;
	
	private JLabel hall_1;
	private JLabel hall_2;
	private JLabel hall_3;
	
	private JLabel area_4;
	private JLabel area_5;
	
	private JLabel taday;//今天的日期
	private JLabel tomorrow;//的日期
	private JLabel lastday;//今天的日期
	
	
	
	private JLabel lblNewLabel;
	private JLabel lblNewLabel_10;
	private JLabel lblNewLabel_16;
	
	
	private static String movieName;
	private static String img;
	
	private String name;
	
	
	

	
	/**
	 * 
	 * @param date 当前日期
	 * @param i 距离当前日期的天数
	 * @return 距离当前日期的i天的日期和星期
	 */
	public String getDate(Date date,int i) {
        Calendar calendar = Calendar.getInstance();
        calendar.setTime(date);
        calendar.add(Calendar.DAY_OF_MONTH, i);
        date = calendar.getTime();
        //格式化
        SimpleDateFormat sdf = new SimpleDateFormat("MM月dd日");//动态获取时间
		String nowTime = sdf.format(date);
        
		int week = calendar.get(Calendar.DAY_OF_WEEK);
		String[] arr = {"(周日)","(周一)","(周二)","(周三)","(周四)","(周五)","(周六)"};
		String nowWeek = arr[week-1];
        return nowTime+nowWeek;
    }
	
	

	public FilmContent(String img) {
		

		getContentPane().setLayout(new BorderLayout());// 边界布局
	
		Map<String ,Object> map=GetFilmAllData.getFilmData(img);
		// 上部图片
		JP_top = new JPanel();
		JP_top.setLayout(null);
		JP_top.setBackground(new Color(255, 255, 255));
		JP_top.setPreferredSize(new Dimension(0, 90));
		getContentPane().add(BorderLayout.NORTH, JP_top);

		// 首页logo图片
		ImageIcon logo = new ImageIcon(Films.class.getResource("logo.png"));
		// 加图片没反应
		logopic = new JLabel(logo);
		logopic.setBounds(60, 15, 158, 69);
		JP_top.add(logopic);

		// 首页城市选择
		city = new JLabel("湘潭");
		city.setBounds(250, 25, 70, 40);
		city.setFont(new Font("楷体", Font.CENTER_BASELINE, 20));
		JP_top.add(city);

		// 首页按钮
		homepage = new JLabel("首页");
		homepage.setBounds(360, 25, 70, 40);
		homepage.setFont(new Font("楷体", Font.CENTER_BASELINE, 20));
		homepage.addMouseListener(this);
		JP_top.add(homepage);
		
	
		

		// 回到影视页面按钮
		film = new JLabel("影片");
		film.setForeground(Color.RED);
		film.setBounds(480, 25, 70, 40);
		film.setFont(new Font("楷体", Font.CENTER_BASELINE, 20));
		film.addMouseListener(this);
		JP_top.add(film);
		
		
		// 回到影院的按钮
		cinema = new JLabel("影院");
		cinema.setBounds(590, 25, 70, 40);
		cinema.setFont(new Font("楷体", Font.CENTER_BASELINE, 20));
		cinema.addMouseListener(this);
		JP_top.add(cinema);
		// 个人中心

		personData = new JLabel("个人中心 |");
		personData.setBounds(1230, 25, 120, 40);
		personData.setFont(new Font("楷体", Font.CENTER_BASELINE, 20));
		personData.addMouseListener(this);
		JP_top.add(personData);

		// 退出
		out = new JLabel("退出");
		out.setBounds(1350, 25, 70, 40);
		out.setFont(new Font("楷体", Font.CENTER_BASELINE, 20));
		out.addMouseListener(this);
		JP_top.add(out);
		
		
		
		//下方面板
		JP_under = new JPanel();
		JP_under.setLayout(null);
		getContentPane().add(BorderLayout.CENTER,JP_under);
		
		//电影所有的大面板
		JP_movie_all = new JPanel();
		JP_movie_all.setBounds(0, 0, 1500, 861);
		JP_under.add(JP_movie_all);
		JP_movie_all.setLayout(null);
		
		//电影详情面板
		JP_movie_content = new JPanel();
		JP_movie_content.setBounds(0, 0, 1500, 300);
		JP_movie_content.setBackground(new Color(111,112,108));
		JP_movie_all.add(JP_movie_content);
		JP_movie_content.setLayout(null);
		
		//电影名
		JP_movie_name = new JLabel(map.get("电影名")+"");
		JP_movie_name.setForeground(Color.WHITE);
		JP_movie_name.setFont(new Font("楷体", Font.CENTER_BASELINE, 20));
		JP_movie_name.setBounds(436, 0, 604, 52);
		JP_movie_name.setBackground(new Color(111,112,108));
		this.name=map.get("电影名")+"";
		
		JP_movie_content.add(JP_movie_name);
		
		//电影图
		Img_movie_img = new ImageIcon(img);
	
		JL_movie_img = new JLabel(Img_movie_img);
		JL_movie_img.setBounds(436, 42, 169, 248);
		JP_movie_content.add(JL_movie_img);
		
		//电影信息
		JP_movie_info = new JPanel();
		JP_movie_info.setSize(413, 248);
		JP_movie_info.setLocation(627, 42);
		JP_movie_info.setBackground(new Color(111,112,108));
		JP_movie_content.add(JP_movie_info);
		JP_movie_info.setLayout(new GridLayout(6, 1, 0, 0));
		
		//电影信息
		director = new JLabel("导演："+map.get("导演")+"");
		director.setFont(new Font("新宋体", Font.PLAIN, 12));
		director.setFont(new Font("楷体", Font.CENTER_BASELINE, 15));
		director.setForeground(Color.WHITE);
		mainActors = new JLabel("演员："+map.get("演员")+"");
		mainActors.setFont(new Font("新宋体", Font.PLAIN, 12));
		mainActors.setFont(new Font("楷体", Font.CENTER_BASELINE, 15));
		mainActors.setForeground(Color.WHITE);
		type = new JLabel("类型："+map.get("电影类型")+"");
		type.setFont(new Font("新宋体", Font.PLAIN, 12));
		type.setFont(new Font("楷体", Font.CENTER_BASELINE, 15));
		type.setForeground(Color.WHITE);
		location = new JLabel("地区："+map.get("地区")+"");
		location.setFont(new Font("新宋体", Font.PLAIN, 12));
		location.setFont(new Font("楷体", Font.CENTER_BASELINE, 15));
		location.setForeground(Color.WHITE);
		time = new JLabel("时长："+map.get("片长")+"分钟");
		time.setFont(new Font("新宋体", Font.PLAIN, 12));
		time.setFont(new Font("楷体", Font.CENTER_BASELINE, 15));
		time.setForeground(Color.WHITE);
		introduction = new JLabel("介绍："+map.get("电影介绍")+"");
		introduction.setFont(new Font("新宋体", Font.PLAIN, 12));
		introduction.setFont(new Font("楷体", Font.CENTER_BASELINE, 15));
		introduction.setForeground(Color.WHITE);
		
		
		JP_movie_info.add(director);
		JP_movie_info.add(mainActors);
		JP_movie_info.add(type);
		JP_movie_info.add(location);
		JP_movie_info.add(time);
		JP_movie_info.add(time);
		JP_movie_info.add(introduction);
		
		JP_selectSeat_all = new JPanel();
		JP_selectSeat_all.setBackground(Color.WHITE);
		JP_selectSeat_all.setBounds(0, 300, 1500, 234);
		JP_movie_all.add(JP_selectSeat_all);
		JP_selectSeat_all.setLayout(null);
		
		//选座购票
		buyTikets = new JLabel("选座购票",JLabel.CENTER);
		buyTikets.setBounds(436, 17, 102, 21);
		buyTikets.setFont(new Font("微软雅黑", Font.PLAIN, 18));
		JP_selectSeat_all.add(buyTikets);
		
		//横线
		lblNewLabel = new JLabel("");
		lblNewLabel.setBackground(Color.GRAY);
		lblNewLabel.setBounds(436, 47, 600, 1);
		lblNewLabel.setOpaque(true); 
		JP_selectSeat_all.add(lblNewLabel);
		
		
		bqian = new JPanel();
		bqian.setLayout(new GridLayout(3, 0, 0, 0));
		bqian.setBounds(436, 58, 600, 158);
		JP_selectSeat_all.add(bqian);
		
		bqian_1 = new JPanel();
		bqian_1.setLayout(null);
		bqian.add(bqian_1);
		
		bqian_2 = new JPanel();
		bqian.add(bqian_2);
		bqian_2.setLayout(null);
		
		bqian_3 = new JPanel();
		bqian.add(bqian_3);
		bqian_3.setLayout(null);
		
		
		selectArea = new JLabel("选择区域",JLabel.CENTER);
		selectArea.setBounds(0, 0, 83, 52);
		selectArea.setBackground(new Color(255,221,220));
		selectArea.setOpaque(true);
		bqian_1.add(selectArea);
		
		allArea = new JLabel("全部区域",JLabel.CENTER);
		allArea.addMouseListener(this);
		allArea.setBounds(98, 15, 75, 25);
		allArea.setOpaque(true);
		allArea.setBackground(Color.RED);
		allArea.setForeground(Color.WHITE);
		bqian_1.add(allArea);
		
		area_1 = new JLabel("韶山市",JLabel.CENTER);
		area_1.setForeground(Color.black);
		area_1.setBounds(200, 15, 50, 25);
		area_1.setBackground(Color.WHITE);
		area_1.addMouseListener(this);
		bqian_1.add(area_1);
		
		area_2 = new JLabel("湘潭县",JLabel.CENTER);
		area_2.setForeground(Color.black);
		area_2.setBounds(275, 15, 50, 25);
		area_2.addMouseListener(this);
		area_2.setBackground(Color.WHITE);
		//area_2.setOpaque(true);
		bqian_1.add(area_2);
		
		
		area_3 = new JLabel("湘乡市",JLabel.CENTER);
		area_3.setForeground(Color.black);
		area_3.setBounds(350, 15, 50, 25);
		area_3.setBackground(Color.WHITE);
		area_3.addMouseListener(this);
		//area_3.setOpaque(true);
		bqian_1.add(area_3);
//		
//		lblNewLabel_12 = new JLabel("岳塘区",JLabel.CENTER);
//		lblNewLabel_12.setBackground(Color.RED);
//		bqian.add(lblNewLabel_12);
//		
//		lblNewLabel_8 = new JLabel("雨湖区",JLabel.CENTER);
//		lblNewLabel_8.setBackground(Color.RED);
//		bqian.add(lblNewLabel_8);
		
		lblNewLabel_10 = new JLabel("选择影城",JLabel.CENTER);
		lblNewLabel_10.setBounds(0, 0, 83, 52);
		lblNewLabel_10.setBackground(new Color(255,221,220));
		lblNewLabel_10.setOpaque(true);
		bqian_2.add(lblNewLabel_10);
		
		
		hall_1 = new JLabel("韶山市城市影城",JLabel.CENTER);
		hall_1.setBounds(98, 15, 96, 25);
		hall_1.setForeground(Color.white);
		hall_1.setBackground(Color.red);
		hall_1.addMouseListener(this);
		hall_1.setOpaque(true);
		bqian_2.add(hall_1);
		
		hall_2 = new JLabel("湘潭县二和影院",JLabel.CENTER);
		hall_2.setBounds(200, 15, 96, 25);
		hall_2.setForeground(Color.black);
		hall_2.addMouseListener(this);
		hall_2.setOpaque(true);
		bqian_2.add(hall_2);
		
		hall_3 = new JLabel("湘乡大地影城",JLabel.CENTER);
		hall_3.setBounds(300, 15, 96, 25);
		hall_3.setForeground(Color.black);
		hall_3.addMouseListener(this);
		hall_3.setOpaque(true);
		bqian_2.add(hall_3);
//		
//		lblNewLabel_9 = new JLabel("城市影院",JLabel.CENTER);
//		lblNewLabel_9.setBackground(Color.RED);
//		bqian.add(lblNewLabel_9);
//		
//		lblNewLabel_7 = new JLabel("城市影院",JLabel.CENTER);
//		lblNewLabel_7.setBackground(Color.RED);
//		bqian.add(lblNewLabel_7);
//		
//		lblNewLabel_17 = new JLabel("城市影院",JLabel.CENTER);
//		lblNewLabel_17.setBackground(Color.RED);
//		bqian.add(lblNewLabel_17);
//		
//		lblNewLabel_15 = new JLabel("城市影院",JLabel.CENTER);
//		lblNewLabel_15.setBackground(Color.RED);
//		bqian.add(lblNewLabel_15);
//		
//		lblNewLabel_16 = new JLabel("城市影院",JLabel.CENTER);
//		lblNewLabel_16.setBackground(Color.RED);
//		bqian.add(lblNewLabel_16);
		
		
		lblNewLabel_16 = new JLabel("选择时间",JLabel.CENTER);
		lblNewLabel_16.setBounds(0, 0, 83, 52);
		lblNewLabel_16.setBackground(new Color(255,221,220));
		lblNewLabel_16.setOpaque(true);
		bqian_3.add(lblNewLabel_16);
		
		
		
		
		//获取当前时间
		Calendar c = Calendar.getInstance();//获取日历实例
		Date date = c.getTime();
		
		String NowDate = getDate(date,0);
		//今天的时间
		taday = new JLabel(NowDate.substring(0, 6)+"(今天)",JLabel.CENTER);
		taday.setBounds(98, 15, 96, 25);
		taday.setBackground(Color.RED);
		taday.setForeground(Color.white);
		taday.addMouseListener(this);
		taday.setOpaque(true);
		bqian_3.add(taday);
		
		
		//获取明天的时间
		String tomorrowDate = getDate(date,1);
		
		//明天的时间
		tomorrow = new JLabel(tomorrowDate,JLabel.CENTER);
		tomorrow.setBounds(200, 15, 96, 25);
		tomorrow.addMouseListener(this);
		tomorrow.setForeground(Color.black);
		tomorrow.setOpaque(true);
		bqian_3.add(tomorrow);
		
		
		//获取后天的时间
		String lastDay = getDate(date,2);//明天的明天就是后天
		
		//后天的时间
		lastday = new JLabel(lastDay,JLabel.CENTER);
		lastday.setBounds(300, 15, 96, 25);
		lastday.setForeground(Color.black);
		lastday.addMouseListener(this);
		lastday.setOpaque(true);
		bqian_3.add(lastday);
		
		
		//场次表
		changci = new JPanel();
		changci.setLayout(new GridLayout(7, 1, 1, 1));
		changci.setBounds(436, 586, 600, 258);
		JP_movie_all.add(changci);
		
		//
		hallName = new JLabel("韶山城市影院");
		hallName.setForeground(Color.RED);
		hallName.setFont(new Font("宋体", Font.PLAIN, 15));
		hallName.setBounds(436, 544, 120, 32);
		JP_movie_all.add(hallName);
		
		//影院地址
		hallAddress = new JLabel("地址：韶山市清溪镇英雄路文艺馆韶山城市影院 ；电话：13332526466");
		
//		地址：湘潭县云湖桥镇北岸村楠竹山敬贤路88号国宇宾馆C栋 [地图] 电话：0731-58263399
//		地址：湘乡市东风路3号万隆中央广场嘉亨茂购物中心5楼 [地图] 电话：0731-56180608
		hallAddress.setForeground(Color.GRAY);
		hallAddress.setFont(new Font("宋体", Font.PLAIN, 11));
		hallAddress.setBounds(560, 544, 356, 32);
		JP_movie_all.add(hallAddress);
		
		//查看详情
		hallsInfor = new JLabel("查看影院详情>");
		hallsInfor.setForeground(Color.red);
		hallsInfor.setFont(new Font("宋体", Font.PLAIN, 11));
		hallsInfor.setBounds(966, 544, 72, 32);
		JP_movie_all.add(hallsInfor);
		
		//场次表头部
		//img_seatInforTop = new ImageIcon(Films.class.getResource("seatInforTop.png"));
		
		seatInforTop = new JPanel();
		seatInforTop.setBackground(new Color(113,106,105));
		changci.add(seatInforTop);
		seatInforTop.setLayout(new GridLayout(0, 6, 0, 2));
		//标题
		JLabel lblNewLabel_6 = new JLabel("放映时间",JLabel.CENTER);
		seatInforTop.add(lblNewLabel_6);
		JLabel lblNewLabel_5 = new JLabel("语言版本",JLabel.CENTER);
		seatInforTop.add(lblNewLabel_5);
		JLabel lblNewLabel_4 = new JLabel("放映厅",JLabel.CENTER);
		seatInforTop.add(lblNewLabel_4);
		JLabel lblNewLabel_3 = new JLabel("座位情况",JLabel.CENTER);
		seatInforTop.add(lblNewLabel_3);
		JLabel lblNewLabel_2 = new JLabel("电影票价",JLabel.CENTER);
		seatInforTop.add(lblNewLabel_2);
		JLabel lblNewLabel_1 = new JLabel("选座购票",JLabel.CENTER);
		seatInforTop.add(lblNewLabel_1);
		
		//第一条场次信息
		changci_infor_1 = new JPanel();
		changci_infor_1.setBackground(new Color(245,245,245));
		changci.add(changci_infor_1);
		changci_infor_1.setLayout(new GridLayout(1, 6, 0, 0));
		
		beginTime = new JLabel("13:30",JLabel.CENTER);
		changci_infor_1.add(beginTime);
		
		language = new JLabel("国语2D",JLabel.CENTER);
		changci_infor_1.add(language);
		
		showAddress = new JLabel("一号厅",JLabel.CENTER);
		changci_infor_1.add(showAddress);
		
		seatsInfor = new JLabel("宽松",JLabel.CENTER);
		changci_infor_1.add(seatsInfor);
		
		price = new JLabel("28",JLabel.CENTER);
		changci_infor_1.add(price);
		
		changci_infor_2 = new JPanel();
		changci_infor_2.setBackground(new Color(245,245,245));
		changci.add(changci_infor_2);
		changci_infor_2.setLayout(new GridLayout(1, 6, 0, 0));
		
		
//		beginTime = new JLabel("13:30",JLabel.CENTER);
//		changci_infor_2.add(beginTime);
//		
//		language = new JLabel("国语2D",JLabel.CENTER);
//		changci_infor_2.add(language);
//		
//		showAddress = new JLabel("一号厅",JLabel.CENTER);
//		changci_infor_2.add(showAddress);
//		
//		seatsInfor = new JLabel("宽松",JLabel.CENTER);
//		changci_infor_2.add(seatsInfor);
//		
//		price = new JLabel("28",JLabel.CENTER);
//		changci_infor_2.add(price);
//		
		selectSeat = new JLabel("选座购票",JLabel.CENTER);
		selectSeat.setOpaque(true); 
		selectSeat.setForeground(Color.WHITE);
		selectSeat.setBackground(Color.RED);
		selectSeat.addMouseListener(this);
		changci_infor_1.add(selectSeat);
//		
//		selectSeat1 = new JLabel("选座购票",JLabel.CENTER);
//		selectSeat1.setOpaque(true); 
//		selectSeat1.setForeground(Color.WHITE);
//		selectSeat1.setBackground(Color.RED);
//		selectSeat1.addMouseListener(this);
//		changci_infor_2.add(selectSeat1);
		
		setTitle("影片");// 标题
		setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);// 点击关闭按钮退出
		setSize(1500, 1000);// 尺寸
		setLocationRelativeTo(null);// 居中
		setVisible(true);// 可见
	}
	

	public static void main(String[] args) {
		new FilmContent(img);
	}


	@Override
	public void mouseClicked(MouseEvent e) {
		// TODO Auto-generated method stub
		Object obj=e.getSource();
		if(obj==selectSeat) {
			
			
			dispose();
			new SelectSeatJframe(name,hallName.getText(),"一号厅");
		}
		if(obj==homepage) {//点击主页
			dispose();
			new HomepageJframe();
		}
		if(obj==film) {//点击影片
			
			
			dispose();
			new Films();
			
		}
		
		if(obj==cinema) {//点击影院
			dispose();
			
			new CinemaFrame(); 
		}
		if(obj==personData) {//点击个人中心
			dispose();
			new mySpace();
		}
		if(obj==out) {
			dispose();
		}
		
		if(obj == allArea) {//点击所有第七
			hall_1.setText("韶山市城市影院");
			hall_2.setText("湘潭县二和影院");
			hall_3.setText("湘乡大地影院");
			
			area_1.setOpaque(false);
			area_1.setForeground(Color.black);
			
			area_2.setOpaque(false);
			area_2.setForeground(Color.black);
			
			area_3.setOpaque(false);
			area_3.setForeground(Color.black);
			
			allArea.setBackground(Color.red);
			allArea.setForeground(Color.white);
			allArea.setOpaque(true);
			
			hallName.setText("韶山市城市影院");
			hallAddress.setText("地址：韶山市清溪镇英雄路文艺馆韶山城市影院 ；电话：13332526466");
			
			
		}
		
		if(obj == area_1) {//点击第一个地区
			allArea.setOpaque(false);
			allArea.setForeground(Color.black);
			
			area_2.setOpaque(false);
			area_2.setForeground(Color.black);
			
			area_3.setOpaque(false);
			area_3.setForeground(Color.black);
			
			area_1.setBackground(Color.red);
			area_1.setForeground(Color.white);
			area_1.setOpaque(true);
			
			
			hall_2.setText("");
			hall_3.setText("");
			hall_1.setText("韶山市城市影院");
			
			hallName.setText("韶山市城市影院");
			hallAddress.setText("地址：韶山市清溪镇英雄路文艺馆韶山城市影院 ；电话：13332526466");
		}
		
		if(obj == area_2) {
			allArea.setOpaque(false);
			allArea.setForeground(Color.black);
			
			area_1.setOpaque(false);
			area_1.setForeground(Color.black);
			
			area_3.setOpaque(false);
			area_3.setForeground(Color.black);
			
			area_2.setBackground(Color.red);
			area_2.setForeground(Color.white);
			area_2.setOpaque(true);
			
			
			hall_1.setText("湘潭县二和影院");
			hall_3.setText("");
			hall_2.setText("");
			
			hallName.setText("湘潭县二和影院");
			hallAddress.setText("地址：湘潭县云湖桥镇北岸村楠竹山敬贤路88号国宇宾馆C栋 ； 电话：0731-58263399");
		}
		
		if(obj == area_3) {
			allArea.setOpaque(false);
			allArea.setForeground(Color.black);
			
			area_1.setOpaque(false);
			area_1.setForeground(Color.black);
			
			area_2.setOpaque(false);
			area_2.setForeground(Color.black);
			
			area_3.setBackground(Color.red);
			area_3.setForeground(Color.white);
			area_3.setOpaque(true);
			
			hall_1.setText("湘乡大地影院");
			hall_2.setText("");
			hall_3.setText("");
			
			hallName.setText("湘乡大地影院");
			hallAddress.setText("地址：湘乡市东风路3号万隆中央广场嘉亨茂购物中心5楼 ； 电话：0731-56180608");
		}
		
		if(obj == hall_1) {//点击第一个影院
			hall_2.setOpaque(false);
			hall_2.setForeground(Color.black);
			
			hall_3.setOpaque(false);
			hall_3.setForeground(Color.black);
			
			hall_1.setBackground(Color.red);
			hall_1.setForeground(Color.white);
			hall_1.setOpaque(true);
			
			hallAddress.setText("地址：韶山市清溪镇英雄路文艺馆韶山城市影院 ；电话：13332526466");
		}
		
		
		if(obj == hall_2) {
			hall_1.setOpaque(false);
			hall_1.setForeground(Color.black);
			
			hall_3.setOpaque(false);
			hall_3.setForeground(Color.black);
			
			hall_2.setBackground(Color.red);
			hall_2.setForeground(Color.white);
			hall_2.setOpaque(true);
			
			hallName.setText("湘潭县二和影院");
			hallAddress.setText("地址：湘潭县云湖桥镇北岸村楠竹山敬贤路88号国宇宾馆C栋 ； 电话：0731-58263399");
		}
		
		if(obj == hall_3) {
			hall_1.setOpaque(false);
			hall_1.setForeground(Color.black);
			
			hall_2.setOpaque(false);
			hall_2.setForeground(Color.black);
			
			hall_3.setBackground(Color.red);
			hall_3.setForeground(Color.white);
			hall_3.setOpaque(true);
			
			hallName.setText("湘乡大地影院");
			hallAddress.setText("地址：湘乡市东风路3号万隆中央广场嘉亨茂购物中心5楼 ； 电话：0731-56180608");
		}
		
		if(obj == taday) {//点击今天
			tomorrow.setOpaque(false);
			tomorrow.setForeground(Color.black);
			
			lastday.setOpaque(false);
			lastday.setForeground(Color.black);
			
			taday.setBackground(Color.red);
			taday.setForeground(Color.white);
			taday.setOpaque(true);
		}
		
		if(obj == tomorrow) {//明天
			taday.setOpaque(false);
			taday.setForeground(Color.black);
			
			lastday.setOpaque(false);
			lastday.setForeground(Color.black);
			
			tomorrow.setBackground(Color.red);
			tomorrow.setForeground(Color.white);
			tomorrow.setOpaque(true);
		}
		
		
		if(obj == lastday) {//后天
			taday.setOpaque(false);
			taday.setForeground(Color.black);
			
			tomorrow.setOpaque(false);
			tomorrow.setForeground(Color.black);
			
			lastday.setBackground(Color.red);
			lastday.setForeground(Color.white);
			lastday.setOpaque(true);
		}
		
		
	
		
	}


	@Override
	public void mousePressed(MouseEvent e) {
		// TODO Auto-generated method stub
		
	}


	@Override
	public void mouseReleased(MouseEvent e) {
		// TODO Auto-generated method stub
		
	}


	@Override
	public void mouseEntered(MouseEvent e) {
		// TODO Auto-generated method stub
		Object obj=e.getSource();
		if(obj==homepage) {
			
			homepage.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));//鼠标移入
		}
		if(obj==film) {
			film.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));//鼠标移入
			}
		if(obj==cinema) {
			cinema.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));//鼠标移入
		
		}
		if(obj==personData) {
			personData.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));//鼠标移入
			
		}
		if(obj==out) {
			out.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));//鼠标移入
		
		}
		
		if(obj == hall_1) {
			hall_1.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));//鼠标移入
		}
		if(obj == hall_2) {
			hall_2.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));//鼠标移入
		}
		if(obj == hall_3) {
			hall_3.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));//鼠标移入
		}
		
		if(obj == allArea) {
			allArea.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));//鼠标移入
		}
		if(obj == area_1) {
			area_1.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));//鼠标移入
		}
		if(obj == area_2) {
			area_2.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));//鼠标移入
		}
		if(obj == area_3) {
			area_3.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));//鼠标移入
		}
		
		if(obj == taday) {
			taday.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));//鼠标移入
		}
		if(obj == tomorrow) {
			tomorrow.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));//鼠标移入
		}
		if(obj == lastday) {
			lastday.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));//鼠标移入
		}
		
		
		
		
	}


	@Override
	public void mouseExited(MouseEvent e) {
		Object obj=e.getSource();
		if(obj == area_1) {
//			area_1.setOpaque(false);
//			area_1.setForeground(Color.black);
//			area_1.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));//鼠标移入
		}
		
		if(obj == area_2) {
//			area_2.setOpaque(false);
//			area_2.setForeground(Color.black);
//			area_2.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));//鼠标移入
		}
		
		if(obj == area_3) {
//			area_3.setOpaque(false);
//			area_3.setForeground(Color.black);
//			area_3.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));//鼠标移入
		}
	}
}

